// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) 
// Source File Name:   PropertiesUtil.java

package com.boci.common.util;

import com.boci.clientapp.main.ClientAppLoader;
import java.io.*;
import java.util.Properties;

public class PropertiesUtil
{

    public PropertiesUtil()
    {
    }

    public static Properties loadPropFromJar(String pPath)
        throws IOException
    {
        InputStream is;
        Properties tmpProperties;
        is = null;
        tmpProperties = new Properties();
        try
        {
            is = com.boci.common.util.PropertiesUtil.class.getResourceAsStream(pPath);
            tmpProperties.load(is);
        }
        catch(IOException e)
        {
            throw e;
        }finally{
        	try{
        		is.close();
        	}catch(IOException e){
        		throw e;
        	}
        }
        return tmpProperties;
    }

    public static Properties loadPropFromFile(String pFilePath)
        throws IOException
    {
        Properties tmpProperties;
        FileInputStream inFile;
        tmpProperties = new Properties();
        inFile = null;
        try
        {
            inFile = new FileInputStream(pFilePath);
            tmpProperties.load(inFile);
        }
        catch(IOException e)
        {
            throw e;
        }finally{
        	try{
        		inFile.close();
        	}catch (IOException e) {
        		throw e;
			}
        }

        return tmpProperties;
    }

    public static void storeProperties(Properties pProp, String strClientUIPath)
        throws IOException
    {
        FileOutputStream outTmp;
        if(!ClientAppLoader.isStandalone())
            return;
        outTmp = null;
        try
        {
            outTmp = new FileOutputStream(strClientUIPath);
            pProp.store(outTmp, null);
        }
        catch(IOException ex)
        {
            throw ex;
        }finally{
        	try {
				outTmp.close();
			} catch (IOException e) {
				// TODO: handle exception
				throw e;
			}
        }
    }
}
